﻿namespace Trukuxzo.Samples.Creational.Patterns.ConcreteFactory
{
    #region usings
    using Trukuxzo.Samples.Creational.Patterns.AbstractFactory;
    using Trukuxzo.Samples.Creational.Patterns.AbstractProduct;
    using Trukuxzo.Samples.Creational.Patterns.Product;
    #endregion

    public class ConcreteFactoryBrowser32bits : AbstractFactoryBrowser
    {
        #region fields
        private ProductChromeBrowser32bits _Chrome32bits;
        private ProductFirefoxBrowser32bits _Firefox32bits;
        #endregion

        #region properties
        public ProductChromeBrowser32bits Chrome32bits
        {
            get
            {
                if (_Chrome32bits == null)
                    _Chrome32bits = new ProductChromeBrowser32bits();

                return _Chrome32bits;
            }
        }

        public ProductFirefoxBrowser32bits Firefox32bits
        {
            get
            {
                if (_Firefox32bits == null)
                    _Firefox32bits = new ProductFirefoxBrowser32bits();

                return _Firefox32bits;
            }
        }
        #endregion

        #region overrides
        public override AbstractProductChromeBrowser CreateProductChromeBrowser()
        {
            return Chrome32bits;
        }

        public override AbstractProductFirefoxBrowser CreateProductFirefoxBrowser()
        {
            return Firefox32bits;
        }
        #endregion
    }
}
